package top.cycarl.anime.ui.ext

import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyGridItemScope
import androidx.compose.foundation.lazy.grid.LazyGridItemSpanScope
import androidx.compose.foundation.lazy.grid.LazyGridScope
import androidx.compose.runtime.Composable

/**
 * @Author: cy
 * @date 2024/3/30 0030 18:01
 * @Version:1.0
 * @Description:
 **/

fun LazyGridScope.fitWidthItem(
    key: Any? = null,
    span: (LazyGridItemSpanScope.() -> GridItemSpan) = { GridItemSpan(maxLineSpan) },
    contentType: Any? = null,
    content: @Composable LazyGridItemScope.() -> Unit
) = item(key, span, contentType, content)